//
//  StartViewController.m
//  GuMoonNews
//
//  Created by 胡发冬 on 16/8/5.
//  Copyright © 2016年 胡发冬. All rights reserved.
//
#define screenWidth self.view.frame.size.width
#define screenHeight self.view.frame.size.height


#import "StartViewController.h"

@interface StartViewController ()
{
    UIImageView *backView;
    UIImageView *urlView;
}
@end

@implementation StartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    backView = [[UIImageView alloc]init];
    
    [backView setImage:[UIImage imageNamed:@"back.png"]];
    
    urlView = [[UIImageView alloc]init];
               //WithFrame:CGRectMake(screenWidth-190, screenHeight-145, 180, 45)];
    
    [urlView setImage:[UIImage imageNamed:@"gumoonurl.PNG"]];
    
    [self performSelector:@selector(createView) withObject:nil afterDelay:0.5f];
    
}


-(void)createView{

    [self.view addSubview:urlView];
    [self.view addSubview:backView];
    

    if (screenWidth<=320) {
        [backView setFrame:CGRectMake(-4, 0, screenWidth+8, screenHeight)];
        [urlView setFrame:CGRectMake(screenWidth-186, screenHeight-145, 180, 45)];
        [UIView animateWithDuration:0.5
                         animations:^{
                             [backView setFrame:CGRectMake(0, 0, screenWidth, screenHeight)];
                             [urlView setFrame:CGRectMake(screenWidth-190, screenHeight-145, 180, 45)];
                         }
                         completion:^(BOOL finished) {
                         }];
    }else{
        [backView setFrame:CGRectMake(0, 0, screenWidth, screenHeight)];
        [urlView setFrame:CGRectMake(screenWidth-190, screenHeight-145, 180, 45)];
    }
    
    
    
    [self.view sendSubviewToBack:backView];
    [self.view bringSubviewToFront:_logBtn];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
